<template>
  <section>
    <div class="wrapper">
      <h2>困难帮扶</h2>
      <ul>
        <li
          v-for="(item, index) in titleList"
          :key="index"
          @click="showPopup({ no: item.no, title: item.title })"
        >
          <i>{{ item.type }}</i>
          <p>{{ item.title }}</p>
          <span>{{ item.en }}</span>
        </li>
      </ul>
    </div>
    <van-popup v-model="show">
      <div class="message">
        <p>
          本人承诺以上所填情况皆真实，愿意接受信息审核对比。若隐瞒或弄虚作假，自愿承担责任。
        </p>
        <ul>
          <li @click="$troute.query('mhApply', obj)">同意</li>
          <li @click="hidePopup">不同意</li>
        </ul>
      </div>
    </van-popup>
    <tabbar v-if="isHide" />
  </section>
</template>
<script>
import Vue from "vue";
import { Popup } from "vant";
import tabbar from "../../components/tabbar.vue";

Vue.use(Popup);

export default {
  components: { tabbar },
  data() {
    return {
      show: false,
      isHide:'',
      titleList: [
        {
          type: "校工会",
          no: "1",
          title: "年度困难补助申请",
          en: "Annual Hardship Allowance Application",
        },
        {
          type: "部门工会",
          title: "临时困难补助申请",
          no: "2",
          en: "Application for temporary Hardship Allowance",
        },
      ],
      obj: {
        no: "",
        title: "",
      },
    };
  },
  mounted() {
    let str=this.$route.query.type;
    if(str==1){
      this.isHide=false
    }
  },
  methods: {
    showPopup(val) {
      this.show = true;
      this.obj.no = val.no;
      this.obj.title = val.title;
    },
    hidePopup() {
      this.show = false;
    },
  },
};
</script>
<style lang="scss" scoped>
section {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  min-height: 100%;
}
.wrapper {
  padding: 25px 20px;
  h2 {
    position: relative;
    display: inline-block;
    font-size: 24px;
    margin-bottom: 25px;
    z-index: 1;
    &::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      bottom: 1px;
      height: 5px;
      background-color: #c9151e;
      z-index: -1;
    }
  }
  ul li {
    margin-top: 20px;
    padding: 20px 20px 20px 80px;
    background: #fff url(../imgs/help-1.png) no-repeat 20px 20px;
    background-size: 50px;
    border-radius: 10px;
    box-shadow: 2px 2px 8px #f2f2f2, -2px -2px 8px #f2f2f2;
    i {
      display: inline-block;
      padding: 3px 15px;
      color: #ef4714;
      font-size: 12px;
      font-style: normal;
      margin-bottom: 5px;
      border: 1px solid #ef4714;
      border-radius: 25px;
    }
    p {
      position: relative;
      font-size: 18px;
      font-weight: bold;
      &::after {
        content: "";
        position: absolute;
        top: 5px;
        right: 0;
        width: 8px;
        height: 13px;
        background: url(../imgs/more.png) no-repeat;
        background-size: contain;
      }
    }
    span {
      color: #999;
      font-size: 10px;
    }
    &:nth-child(2) {
      background-image: url(../imgs/help-2.png);
      i {
        color: #0088ff;
        border-color: #0088ff;
      }
    }
  }
}
.van-popup {
  width: 90%;
  border-radius: 10px;
}
.message {
  padding: 25px;
  border-radius: 10px;
  p {
    margin: 15px 0 40px;
    line-height: 1.75em;
    font-size: 16px;
    text-indent: 2em;
    text-align: justify;
  }
  ul {
    display: flex;
    margin: 0 -10px;
    li {
      flex-grow: 1;
      padding: 10px 0;
      margin: 0 10px;
      color: #9e0f16;
      font-size: 18px;
      font-weight: bold;
      text-align: center;
      border: 1px solid #9e0f16;
      border-radius: 23px;
      &:last-child {
        color: #fff;
        background-color: #9e0f16;
      }
    }
  }
}
</style>